<template>
	<view class="content">
		<pyh-nv :config="config"></pyh-nv>
		<view class="dataBox">
			<view class="dataItem" v-for="(item,index) in data" :key="index">
				<image :src="item.avatar" class="avatar"></image>
				<text class="nickname">{{item.nickname}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				config: {
					title: '社群成员',
					bgColor: 'transparent',
					color: '#000000',
				},
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.$request.get(`CommunityUser/member_list?id=${this.id}`).then(res => {
				this.data = res.data.data;
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.dataBox {
		margin-top: 80rpx;
		width: 676rpx;
		margin-left: 37rpx;
		.dataItem {
			float: left;
			width: 105rpx;
			height: 150rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-bottom: 90rpx;
			margin-right: 85rpx;
			.avatar {
				width: 105rpx;
				height: 105rpx;
				border-radius: 50%;
			}

			.nickname {
				width: 100%;
				text-align: center;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				font-size: 24rpx;
				font-weight: 700;
			}
		}
		.dataItem:nth-child(4n) {
		  margin-right: 0;
		}
	}

	.content {
		width: 100%;
		height: 100vh;
		background: url('https://miantou.guguan.net/img/association/associationUserBg.jpg');
		background-size: 100% 100%;
		overflow: hidden;
	}
</style>